<!DOCTYPE html>
<html>
<head th:include="common/header_css::header('霸王餐小程序后台管理-商品信息','%mfile%datepicker%summernote')"></head>
<!--<head th:include="common/header_css::header('霸王餐小程序后台管理-优惠券模板')"></head>-->
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div th:replace="common/toolbar::toolbar('优惠券模板管理')"></div>
        <div th:replace="common/search::search('%coupontpl%add')"></div>
    </div>
</div>

<!--添加CouponTpl模态框-->
<div id="modal-add-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">优惠券模板添加</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="aform" method="post" class="form-horizontal" action="add"
                                      onsubmit="return checkAdd()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">券模板名称*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="name"
                                                           required type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">优惠券类型*</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="type" id="type2"
                                                            onchange="typeChange(this.value,'add')">
                                                        <option value="">请选择</option>
                                                        <option th:each="c:${quantypes}" th:value="${c.type}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">能否重复领用*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isRepeat" value="1">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group" id="repeatNumDiv">
                                                <label class="col-sm-4 control-label">可重复领取张数
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="repeatNum" type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" style="display: none">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">库存</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="total" required type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <!--<div class="form-group" style="display: none">-->
                                                <!--<label class="col-sm-4 control-label">折扣券最大折扣额</label>-->
                                                <!--<div class="col-sm-8">-->
                                                    <!--<input class="form-control" name="maxvalue" type="number"/>-->
                                                <!--</div>-->
                                            <!--</div>-->
                                        </div>
                                    </div>
                                    <div class="row" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group" data-admin="1">
                                                <label class="col-sm-4 control-label">长期有效</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="isForever"
                                                            onchange="isForeverChange(this.value)">
                                                        <option value="1">是</option>
                                                        <option value="-1">否</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group" id="validTypeDiv" style="display: none">
                                                <label class="col-sm-4 control-label">生效方式*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="validType"
                                                            onchange="validTypeChange(this.value)">
                                                        <option value="1">领取生效</option>
                                                        <!--<option value="2">固定日期开始生效</option>-->
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="rowexpire" style="display: none" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">有效期(天)</label>
                                                <div class="col-sm-8">
                                                    <input type="number" class="form-control" name="expire">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label"></label>
                                                <div class="col-sm-8"></div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="rowtime" style="display: none" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">生效日期
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="date" class="form-control selectData" readonly
                                                           id="starttime" name="starttime">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">结束日期
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="date" class="form-control selectData" readonly
                                                           id="endtime" name="endtime">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row less10">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">券价值<span class="eq10"
                                                                                               style="display: none">次</span>*</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="cost" required type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group" id="useminDiv" style="display: none">
                                                <label class="col-sm-4 control-label">使用起始值</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="usemin2" name="usemin"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">适用商品范围*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="allcategory"
                                                            onchange="allcategoryChange(this.value)">
                                                        <option value="0">全场通用</option>
                                                        <option value="1">某类类别商品可用</option>
                                                        <option value="2">某商品可用</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group" data-admin="1" th:if="${isAdmin==1}">
                                                <label class="col-sm-4 control-label">是否系统券模板</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" class="js-switch" name="isSystem" value="-1">
                                                </div>
                                            </div>

                                        </div>
                                    </div>
                                    <div class="rowallcategory" style="display: none" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">所有适合大类的类别ID</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="categories"
                                                           type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">适合的商品id
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" name="gids"
                                                           type="text" maxlength="500"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="asidrow" style="display: none" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">选择商家</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="sid">
                                                        <option value="">非商家券</option>
                                                        <option th:each="c:${mchs}" th:value="${c.id}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                            <!--<div class="form-group">-->
                                            <!--<label class="col-sm-4 control-label">是否商家券</label>-->
                                            <!--<div class="col-sm-8">-->
                                            <!--<input type="checkbox" class="js-switch" name="ismch" value="-1">-->
                                            <!--</div>-->
                                            <!--</div>-->
                                        </div>
                                        <div class="col-md-6">
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">所属商家</label>
                                                <div class="col-sm-10">
                                                    <select class="form-control" name="sid">
                                                        <option th:each="c:${stores}" th:value="${c.id}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">优惠券描述</label>
                                                <div class="col-sm-10">
                                                    <textarea class="form-control" name="remark"
                                                              maxlength="300"></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" style="display: none" id="mfileadd">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">券图(用于卡类型)
                                                </label>
                                                <div class="col-sm-10">
                                                    <input id="mfile" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-add-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="hidpic" name="pic" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--修改CouponTpl模态框-->
<div id="modal-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <h3 class="m-t-none m-b">优惠券模板修改</h3>
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <form id="mform" method="post" class="form-horizontal" action="modify"
                                      onsubmit="return checkModify()">
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">券模板名称 *
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="name" name="name"
                                                           required type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">优惠券类型*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" name="type" id="type"
                                                            onchange="typeChange(this.value,'modify')">
                                                        <option value="">请选择</option>
                                                        <!--<option value="1">代金券</option>-->
                                                        <!--<option value="2">满减券</option>-->
                                                        <!--<option value="3">折扣券</option>-->
                                                        <option th:each="c:${quantypes}" th:value="${c.type}"
                                                                th:text="${c.name}"></option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">能否重复领用*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" id="isRepeat" name="isRepeat"
                                                            onchange="isRepeatChange(this.value)">
                                                        <option value="-1">否</option>
                                                        <option value="1">是</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group" id="repeatNumDiv2">
                                                <label class="col-sm-4 control-label">可重复领取张数
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="repeatNum" name="repeatNum"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">库存</label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="total" name="total" required
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <!--<div class="form-group" style="display: none">-->
                                                <!--<label class="col-sm-4 control-label">折扣券最大折扣额</label>-->
                                                <!--<div class="col-sm-8">-->
                                                    <!--<input class="form-control" id="maxvalue" name="maxvalue"-->
                                                           <!--type="number"/>-->
                                                <!--</div>-->
                                            <!--</div>-->
                                        </div>
                                    </div>
                                    <div class="row" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group" data-admin="1">
                                                <label class="col-sm-4 control-label">是否长期有效</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" id="isForever" name="isForever"
                                                            onchange="isForeverChange(this.value)">
                                                        <option value="1">是</option>
                                                        <option value="-1">否</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group" id="validTypeDiv2" style="display: none">
                                                <label class="col-sm-4 control-label">生效方式*</label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" id="validType" name="validType"
                                                            onchange="validTypeChange(this.value)">
                                                        <option value="1">领取生效</option>
                                                        <!--<option value="2">固定日期开始生效</option>-->
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="rowexpire2" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">有效期(天)</label>
                                                <div class="col-sm-8">
                                                    <input type="number" class="form-control selectData" id="expire"
                                                           name="expire">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label"></label>
                                                <div class="col-sm-8"></div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" id="rowtime2" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">生效日期
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="date" class="form-control selectData" readonly
                                                           id="starttime2" name="starttime">
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">结束日期
                                                </label>
                                                <div class="col-sm-8">
                                                    <input type="date" class="form-control selectData" readonly
                                                           id="endtime2" name="endtime">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row less10">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">券价值<span class="eq10"
                                                                                               style="display: none">次</span>*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="cost" name="cost"
                                                           required type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group" id="useminDiv2" style="display: none">
                                                <label class="col-sm-4 control-label">使用起始值
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="usemin" name="usemin"
                                                           type="number"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">适用商品范围*
                                                </label>
                                                <div class="col-sm-8">
                                                    <select class="form-control" id="allcategory" name="allcategory"
                                                            onchange="allcategoryChange(this.value)">
                                                        <option value="0">全场通用</option>
                                                        <option value="1">某类类别商品可用</option>
                                                        <option value="2">某商品可用</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group" data-admin="1" th:if="${isAdmin==1}">
                                                <label class="col-sm-4 control-label">是否系统券模板</label>
                                                <div class="col-sm-8">
                                                    <input type="checkbox" id="isSystem" name="isSystem" value="-1">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="rowallcategory2" style="display: none" class="ncika">
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">所有适合大类的类别ID
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="categories" name="categories"
                                                           type="text" maxlength="200"/>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="col-md-6">
                                            <div class="form-group">
                                                <label class="col-sm-4 control-label">适合的商品id*
                                                </label>
                                                <div class="col-sm-8">
                                                    <input class="form-control" id="gids" name="gids"
                                                           type="text" maxlength="500"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!----暂不支持优惠券模板修改---->
                                    <!--<div class="row" id="msidrow">-->
                                    <!--<div class="col-md-6">-->
                                    <!--<div class="form-group">-->
                                    <!--<label class="col-sm-4 control-label">是否商家券</label>-->
                                    <!--<div class="col-sm-8">-->
                                    <!--<input type="checkbox" class="js-switch" id="ismch" name="ismch" value="-1">-->
                                    <!--</div>-->
                                    <!--</div>-->
                                    <!--</div>-->
                                    <!--<div class="col-md-6">-->
                                    <!--<div class="form-group">-->
                                    <!--<label class="col-sm-4 control-label">选择商家</label>-->
                                    <!--<div class="col-sm-8">-->
                                    <!--<select class="form-control" name="sid">-->
                                    <!--<option th:each="c:${mchs}" th:value="${c.id}" th:text="${c.name}"></option>-->
                                    <!--</select>-->
                                    <!--</div>-->
                                    <!--</div>-->
                                    <!--</div>-->
                                    <!--</div>-->
                                    <div class="row">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">优惠券描述</label>
                                                <div class="col-sm-10">
                                                    <textarea id="remark" name="remark" class="form-control"
                                                              maxlength="300"></textarea>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row" style="display: none" id="mfilemodify">
                                        <div class="col-md-12">
                                            <div class="form-group">
                                                <label class="col-sm-2 control-label">券图(用于卡类型)
                                                </label>
                                                <div class="col-sm-10">
                                                    <input id="mfilepic" name="mfile" type="file" class="file"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-primary" type="submit">保存内容</button>
                                            <button data-toggle="modal" type="button" class="btn btn-white"
                                                    href="#modal-form">取消
                                            </button>
                                        </div>
                                    </div>
                                    <input id="id" name="id" type="hidden" value=""/>
                                    <input id="hidpic2" name="pic" type="hidden" value=""/>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--设置券商品模态框-->
<div id="quangoods-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog" style="width: 800px;">
        <div class="modal-content">
            <div class="modal-body">
                <form id="qform" method="post" class="form-horizontal" action="addQuangoods"
                      onsubmit="return checkAddquan()">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商品名*</label>
                                <div class="col-sm-10">
                                    <input class="form-control" id="gname" name="name"
                                           required type="text" maxlength="255"/>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商品特色</label>
                                <div class="col-sm-10">
                                    <input class="form-control" id="characteristic" name="characteristic" type="text" maxlength="255"/>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">商品原价*
                                </label>
                                <div class="col-sm-8">
                                    <input class="form-control" id="price" name="price" required type="number"/>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label class="col-sm-4 control-label">实际售价*
                                </label>
                                <div class="col-sm-8">
                                    <input class="form-control" id="saleprice" name="saleprice" required type="number"/>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商品轮播图</label>
                                <div class="col-sm-10">
                                    <input id="mfilephotos" name="mfile" multiple type="file" class="file"/>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商品详情</label>
                                <div class="col-sm-10">
                                    <input id="mfileinfo" name="mfile" multiple type="file" class="file"/>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row" style="margin-top: 20px">
                        <div class="col-sm-4 col-sm-offset-2">
                            <button class="btn btn-primary" type="submit">保存</button>
                            <button data-toggle="modal" type="button" class="btn btn-white" href="#quangoods-form">取消</button>
                        </div>
                    </div>
                    <input id="hidphotos" name="photos" type="hidden" value=""/>
                    <input id="hidinfo" name="info" type="hidden" value=""/>
                    <input id="gid" name="id" type="hidden" value=""/>
                    <input id="tplid" name="tplid" type="hidden" value=""/>
                </form>
            </div>
        </div>
    </div>
</div>

<input id="multisid" type="hidden" th:value="${multisid}"/>
<input id="isAdmin" type="hidden" th:value="${isAdmin}"/>
<input id="utype" type="hidden" th:value="${utype}"/>
<div th:include="common/footer_js::footer"></div>
<script>

    //图片上传
    function sendFile(file, editor, $editable) {

        var filename = false;
        try {
            filename = file['name'];
        } catch (e) {
            filename = false;
        }
        if (!filename) {
            $(".note-alarm").remove();
        }
        //以上防止在图片在编辑器内拖拽引发第二次上传导致的提示错误
        data = new FormData();
        data.append("mfile", file);
        data.append("key", filename); //唯一性参数

        $.ajax({
            data: data,
            type: "POST",
            url: "/upload/file?type=sn_CouponTpl",
            cache: false,
            contentType: false,
            processData: false,
            success: function (e) {
                console.log(e)
                if (e && e.code != 0) {
                    swal({title: "上传失败", text: "", type: "error"})
                    return;
                } else {
                    swal({title: "上传成功", text: "", type: "success"})
                }
                editor.insertImage($editable, e.data);
                setTimeout(function () {
                    $(".note-alarm").remove();
                }, 5000);
            },
            error: function () {
                swal({title: "上传失败", text: "", type: "error"})
                return;
            }
        });
    }

    $(document).ready(function () {

        if ($("#multisid").val() == 'true') {
            $("#asidrow").show();
        }

    });
</script>
<script src="/js/admin/coupontpl.js"></script>
</body>
</html>
